package com.eh.observer.jdk_observer.observable;

import com.eh.observer.dto.Event;

import java.util.Observable;

/**
 * Created by David on 2016/4/23.
 */
public class JdkWeatherData extends Observable {
    private float temperature;
    private float humidity;
    
    public void measurementsChanged() {
        setChanged();
        notifyObservers(new Event(temperature, humidity));
    }

    public void setMeasurements(float temperature, float humidity) {
        this.temperature = temperature;
        this.humidity = humidity;
        measurementsChanged();
    }
}
